$def with(form = False)

$ scripts = ['libs/jquery.js', 'libs/jquery.tools.min.js']
$ user_session = current_user()

$:render.common.header(title = '推荐猫优', scripts = scripts)

				<div class="shindantitle">
					<h1>推荐猫优</h1>
				</div>
				<div class="blue">
					<div class="title2">
						<h2>推荐猫优</h2>　<span style="font-size:0.8em;"><span class="imp">*</span>必须</span>
					</div>
                    <script type="text/javascript">
                        $$(function() {
                            $$.tools.validator.fn('[name=name]', function(input, value) {
                                value = $$.trim(value);
                                if (value == '')
                                    return '您忘记输入猫优名啦。'
                                if (value.length > 30)
                                    return '猫优名太长了（最多30个字）'
                                return true;
                            });
                            $$.tools.validator.fn('[name=url]', function(input, value) {
                                value = $$.trim(value);
                                if (value == '')
                                    return '请告诉我们您推荐的猫优的博客地址。'
                                if (value.length > 255)
                                    return '猫优的博客地址太长了（最多255个字符哟）';
                                return true;
                            });
                            $$.tools.validator.fn('[name=fields]', function(input, value) {
                                value = $$.trim(value);
                                if (value == '')
                                    return '您推荐的猫优擅长什么领域？';
                                if (value.length > 256)
                                    return '字段值太长了（最多256个字符哟）';
                                return true;
                            });
                            var form = $$('form').validator({
                                position: 'top left',
                                offset: [-12, 0],
                                message: '<div><em/></div>'
                            });

                            var json = {};
                            $if form and not form.valid:
                                $for input in form.inputs:
                                    $if input.note:
                                        json['$input.name'] = '$input.note';
                                        $$('[name=$input.name]').keypress(function() {
                                            form.data('validator').reset($$(this));
                                            $$(this).unbind('keypress');
                                        });
                            if (json) {
                                form.data('validator').invalidate(json);
                            }
                            
                        });
                    </script>

					<form method="post">
						<div class="postbox">
    <div class="postaboutlist2 postexample">
        ※ 为确保猫克斯只收录IT从业者的博客，猫克斯会对您推荐的猫优进行审核，这最多只需要十二小时。
    </div>

							<div class="clearfix">
								<div class="postcell1">
									<div class="postcell_i">■推荐人</div>
								</div>
								<div class="postcell2">
                                    <div class="postcell_i">
                                        $if user_session.logined:
                                            $user_session.name&nbsp;[<a href="/logout">退出</a>] 
                                        $else:
									        <b>匿名推荐</b><span class="postdesc">（<a href="/login">登录</a>之后，您将成为猫友的一员，拥有自己独立的猫友主页，您推荐的所有猫优都会被收集在那里。※ (<a href="/user/maocos" target="_blank">例</a>）</span>
                                    </div>
								</div>
							</div>

							<div class= "clearfix">
								<div class="postcell1">
									<div
                                        class="postcell_i">■$form.name.description<span class="imp">*</span></div>
								</div>
								<div class="postcell2">
									<div class="postcell_i">
										$:form.name.render()<br />
										<span class="postdesc">博客名、真实姓名，网名等等任意名称。例 <span class="postexample">猫克斯官方博客</span></span>
									</div>
								</div>
							</div>


							<div class= "clearfix">
							<div class="postcell1"><div class="postcell_i">
							■$form.url.description<span class="imp">*</span>
							</div></div>
							<div class="postcell2"><div class="postcell_i">
							$:form.url.render()<br />
							<span class="postdesc">猫克斯只会收录猫优的个人或团队博客、网站。例 <span class="postexample">http://blog.maocos.com/</span></span>
							</div></div>
							</div>



<div class= "clearfix">
<div class="postcell1"><div class="postcell_i2">
■$form.fields.description<span class="imp">*</span>
</div></div>
<div class="postcell3">
    <div class="postcell_i2">
        $:form.fields.render()
    </div>
</div>
<div class="postcell4"><div class="postcell_i2">
<span class="postdesc">例<br />
<span class="postexample">
python<br />
影音处理<br />
产品经理<br />
Linux<br />
UI<br />
</span>
</span>
</div></div>
</div>

<div class="postaboutlist2">
    <b>1行1项领域。</b>每项领域字数请控制在10个中文，20个英文字母以内，总的擅长领域请控制<b>5</b>个以内。总字数不宜超过<b>256</b>个中文（512个英文字母）。
</div>

	<div style="padding: 20px; text-align: center; margin-bottom: 30px;">
        <input type="submit" value="确认推荐">
    </div>
</form>

</div>


</div>

$:render.common.footer(make_disabled = True)
